﻿using System;
using Hopscotch.Common.Contracts.AppService;
using Hopscotch.Domain.Common.Enums;
using Hopscotch.Domain.Finance;

namespace Hopscotch.Server.AppServiceFake
{
    public class InstrumentService : FakeServiceIntKey<Instrument>, IInstrumentService
    {
        private static bool isInitialized;

        public InstrumentService()
        {
            Initialize();
        }

        private void Initialize()
        {
            if (isInitialized)
                return;

            Add(new EquityInstrument { Id = 1000, Type = InstrumentType.Equity, Ticker = "LUK", Name = "Leucadia", LotSize = 1, DefaultCurrency = "USD" });
            Add(new EquityInstrument { Id = 1001, Type = InstrumentType.Equity, Ticker = "MSFT", Name = "Microsoft", LotSize = 1, DefaultCurrency = "USD" });
            Add(new EquityInstrument { Id = 1002, Type = InstrumentType.Equity, Ticker = "RBS", Name = "RBS", LotSize = 1, DefaultCurrency = "GBP" });
            Add(new EquityInstrument { Id = 1003, Type = InstrumentType.Equity, Ticker = "BARC", Name = "Barclays PLC", LotSize = 1, DefaultCurrency = "GBP" });
            Add(new EquityInstrument { Id = 1004, Type = InstrumentType.Equity, Ticker = "GSK", Name = "GSK", LotSize = 1, DefaultCurrency = "GBP" });

            Add(new EquityInstrument { Id = 1005, Type = InstrumentType.Equity, Ticker = "1 HK", Name = "Cheung Kong (Holdings) Limited", LotSize = 1000, DefaultCurrency = "HKD" });
            Add(new EquityInstrument { Id = 1006, Type = InstrumentType.Equity, Ticker = "2 HK", Name = "CLP Holdings Limited", LotSize = 500, DefaultCurrency = "HKD" });
            Add(new EquityInstrument { Id = 1007, Type = InstrumentType.Equity, Ticker = "5 HK", Name = "HSBC Holdings plc (Hong Kong)", LotSize = 400, DefaultCurrency = "HKD" });

            isInitialized = true;
        }


    }
}
